package cc.geguol.iodemo.bytedemo;

import java.util.Properties;

/**
 * 我是GBK
 */
public class EncodeLen {
	public static void main(String[] args) {
//		showByteLen();
	    showSystemProprity();
	}

	private static void showByteLen() {
		//		System.setProperty("file.encoding","GBK");
		String str = "你好hello";
		int byte_len = str.getBytes().length;
		int len = str.length();
		System.out.println("字节" + byte_len);
		System.out.println("字符" + len);
		System.out.println("编码" + System.getProperty("file.encoding"));
	}

	public static void showSystemProprity(){
		Properties properties = System.getProperties();
		System.out.println(properties);
	/*	properties.keySet().forEach(o ->
				System.out.println(o.toString()+":"+properties.get(o).toString()));*/
	}
}
